package com.awesome.viewpagerdemo.viewpager;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.awesome.sdk.util.ShowLogUtil;

/**
 * Author: zhangjingfang
 * Email:zhangjingfang@jeejio.com
 * Date: 2021/8/31 10:11 下午
 * Description:类描述
 */
public class FragmentAdapter extends FragmentPagerAdapter {

    private Fragment[] mFragments;

    public FragmentAdapter(FragmentManager fm,Fragment[] fragments) {
        super(fm);
        mFragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        ShowLogUtil.info("getItem=" + position);
        return mFragments[position];
    }

    @Override
    public int getCount() {
        return mFragments.length;
    }
} 